//
//  VCOrderDetailBottom.m
//  express
//
//  Created by mac1 on 15/9/10.
//  Copyright (c) 2015年 longchen. All rights reserved.
//

#import "VCOrderDetailBottom.h"
#import "VCOrderDetail.h"


@interface VCOrderDetailBottom ()

@property (nonatomic, strong) UITableViewController* vcRouteInfo;

@property (nonatomic, strong) UITableViewController* vcHandler;

@property (nonatomic, strong) UITableViewController* vcContactInfo;

@property (nonatomic, strong) UITableViewController* vcReceipt;

@end

@implementation VCOrderDetailBottom

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.
}

//!@brief 显示路由信息
-(void)showRouteInfo
{
    //移除所有子视图
    for(UIView * view in self.view.subviews)
        [view removeFromSuperview];
    
    //移除所有子控制器
    for(UIViewController * vc in self.childViewControllers)
        [vc removeFromParentViewController];
    
    //从StoryBoard创建 路由信息 控制器，不能由类的对象加载，
    self.vcRouteInfo = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"IDVCRouteInfo"];

    //添加 路由信息 控制器
    [self addChildViewController:self.vcRouteInfo];

    //将 路由信息 的视图加入到当前视图的子视图中，以显示出来
    [self.view addSubview:self.vcRouteInfo.view];
}

//!@brief 显示经手人
-(void)showHandler
{
    //移除所有子视图
    for(UIView * view in self.view.subviews)
        [view removeFromSuperview];
    
    //移除所有子控制器
    for(UIViewController * vc in self.childViewControllers)
        [vc removeFromParentViewController];
    
    //从StoryBoard创建 路由信息 控制器，不能由类的对象加载，
    self.vcHandler = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"IDVCHandler"];
    
    //添加 路由信息 控制器
    [self addChildViewController:self.vcHandler];
    
    //将 路由信息 的视图加入到当前视图的子视图中，以显示出来
    [self.view addSubview:self.vcHandler.view];
}

//!@brief 显示往来信息
-(void)showContactInfo
{
    //移除所有子视图
    for(UIView * view in self.view.subviews)
        [view removeFromSuperview];
    
    //移除所有子控制器
    for(UIViewController * vc in self.childViewControllers)
        [vc removeFromParentViewController];
    
    //从StoryBoard创建 路由信息 控制器，不能由类的对象加载，
    self.vcContactInfo = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"IDVCContactInfo"];
    
    //添加 路由信息 控制器
    [self addChildViewController:self.vcContactInfo];
    
    //将 路由信息 的视图加入到当前视图的子视图中，以显示出来
    [self.view addSubview:self.vcContactInfo.view];
}

//!@brief 显示底单
-(void)showReceipt
{
    //移除所有子视图
    for(UIView * view in self.view.subviews)
        [view removeFromSuperview];
    
    //移除所有子控制器
    for(UIViewController * vc in self.childViewControllers)
        [vc removeFromParentViewController];
    
    //从StoryBoard创建 路由信息 控制器，不能由类的对象加载，
    self.vcReceipt = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"IDVCReceipt"];
    
    //添加 路由信息 控制器
    [self addChildViewController:self.vcReceipt];
    
    //将 路由信息 的视图加入到当前视图的子视图中，以显示出来
    [self.view addSubview:self.vcReceipt.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//#pragma mark - Navigation
//
//// In a storyboard-based application, you will often want to do a little preparation before navigation
//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
//     //Get the new view controller using [segue destinationViewController].
//     //Pass the selected object to the new view controller.
//
//}


@end
